package com.xyg.product.model;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

import com.xyg.common.model.DataEntity;

import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper=false)
@Entity
@Table(name="xyg_product_brand")
public class Brand extends DataEntity<Brand, Long> {

	private String name;
	
	private String icon;
	
	private String description;
	
	private Status status;
	
	@ManyToMany(fetch=FetchType.LAZY,cascade={CascadeType.REFRESH,CascadeType.PERSIST,CascadeType.REMOVE,CascadeType.MERGE})
	private Set<Category> cotegories = new HashSet<>();
	

	public enum Status {
		normal,disable,deleted
	}
}
